//---------------------------------------------------------------------------

#ifndef TestSerialH
#define TestSerialH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "iComponent.hpp"
#include "iCustomComponent.hpp"
#include "iLed.hpp"
#include "iLedRound.hpp"
#include "iPlot.hpp"
#include "iPlotComponent.hpp"
#include "iVCLComponent.hpp"
#include <Dialogs.hpp>
#include <ExtCtrls.hpp>


// 수신 쓰레드---------------------------------------------------------------------------
class TThreadBit : public TThread
{
public :
        __fastcall TThreadBit(void);

private :
        int tindx;
        void __fastcall Execute();
        void __fastcall UpdateRecv();
};

// 송신 쓰레드
class TWriteThread : public TThread
{
public:
        __fastcall TWriteThread(void);

private:
        void __fastcall Execute();
};

  
class TForm2 : public TForm
{
__published:	// IDE-managed Components
        TMemo *Memo1;
        TMemo *Memo2;
        TLabel *Label1;
        TLabel *Label2;
        TiPlot *iPlot1;
        TiLedRound *iLedRound1;
        TiLedRound *iLedRound2;
        TLabel *Label3;
        TLabel *Label4;
        TButton *Button2;
        TButton *Button3;
        TButton *Button4;
        TTimer *Timer1;
        TButton *Button5;
        TOpenDialog *OpenDialog1;
        void __fastcall FormCreate(TObject *Sender);
        void __fastcall Button1Click(TObject *Sender);
        void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
        void __fastcall Button3Click(TObject *Sender);
        void __fastcall Button4Click(TObject *Sender);
        void __fastcall Button5Click(TObject *Sender);
	void __fastcall Button2Click(TObject *Sender);
private:	// User declarations

        TThreadBit*     ThreadBit;
        TWriteThread*   WriteThread;

public:		// User declarations

		
        __fastcall TForm2(TComponent* Owner);
        void DelayTime(int iTime);
        void StartAllThread(void);
        void StopAllThread(void);
        void SetGrid(float  time, float  number);
        void FileSave(int file, char* message);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm2 *Form2;
//---------------------------------------------------------------------------
#endif
